#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

int main()
{
	int fd = 0;
	char buf[100] = {0};
	int ret = 0;

	fd = open("./pipe",O_RDONLY);
	if(fd == -1)
	{
		perror("open");
		exit(-1);
	}

	sleep(10);

	ret = read(fd,buf,sizeof(buf) - 1);
	if(ret == -1)
	{
		perror("write");
		exit(-1);
	}

	printf("buf is %s\n",buf);

	close(fd);

	return 0;
}
